# Maintainer: Jaroslav Lichtblau <svetlemodry@archlinux.org>
# Contributor: Daniel Wallace <danielwallace at gtmanfred dot com>

pkgname=reptyr
pkgver=0.9.0
pkgrel=1
pkgdesc='Utility for taking an existing running program and attaching it to a new terminal'
arch=('loong64' 'x86_64')
license=('BSD')
url="https://github.com/nelhage/reptyr"
depends=('glibc')
source=($pkgname-$pkgver.tar.gz::https://github.com/nelhage/$pkgname/tarball/$pkgname-$pkgver)
sha256sums=('8022af82c8f80299386e3200041980def5f8de38385a35d84b55b70aae9a9545')

prepare() {
  cd "${srcdir}"/nelhage-$pkgname-*

  sed -i 's|etc/bash_completion.d|usr/share/bash-completion/completions|' Makefile
}

build() {
  cd "${srcdir}"/nelhage-$pkgname-*

  make
}

package() {
  cd "${srcdir}"/nelhage-$pkgname-*

  make DESTDIR="${pkgdir}" PREFIX=/usr install
  install -Dm644 COPYING "${pkgdir}"/usr/share/licenses/reptyr/LICENSE
}
